package cn.net.dpi.shp.model.entity;

import cn.net.dpi.shp.handler.LineStringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.locationtech.jts.geom.LineString;

import java.io.Serializable;

/**
 * @TableName bxf_bac
 */
@TableName(value = "bxf_bac")
@Data
public class BxfBac implements Serializable {
    /**
     *
     */
    @TableId
    private Integer fid;

    /**
     *
     */
    @TableField(typeHandler = LineStringTypeHandler.class)
    private LineString theGeom;

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Long lbrid;

    /**
     *
     */
    private Long marking;

    /**
     *
     */
    private Long subtype;

    /**
     *
     */
    private Long sequence;

    /**
     *
     */
    private Long rangetype;

    /**
     *
     */
    private Long startposit;

    /**
     *
     */
    private Long endpositio;

    private Long fileId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BxfBac other = (BxfBac) that;
        return (this.getFid() == null ? other.getFid() == null : this.getFid().equals(other.getFid()))
                && (this.getTheGeom() == null ? other.getTheGeom() == null : this.getTheGeom().equals(other.getTheGeom()))
                && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getLbrid() == null ? other.getLbrid() == null : this.getLbrid().equals(other.getLbrid()))
                && (this.getMarking() == null ? other.getMarking() == null : this.getMarking().equals(other.getMarking()))
                && (this.getSubtype() == null ? other.getSubtype() == null : this.getSubtype().equals(other.getSubtype()))
                && (this.getSequence() == null ? other.getSequence() == null : this.getSequence().equals(other.getSequence()))
                && (this.getRangetype() == null ? other.getRangetype() == null : this.getRangetype().equals(other.getRangetype()))
                && (this.getStartposit() == null ? other.getStartposit() == null : this.getStartposit().equals(other.getStartposit()))
                && (this.getEndpositio() == null ? other.getEndpositio() == null : this.getEndpositio().equals(other.getEndpositio()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFid() == null) ? 0 : getFid().hashCode());
        result = prime * result + ((getTheGeom() == null) ? 0 : getTheGeom().hashCode());
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLbrid() == null) ? 0 : getLbrid().hashCode());
        result = prime * result + ((getMarking() == null) ? 0 : getMarking().hashCode());
        result = prime * result + ((getSubtype() == null) ? 0 : getSubtype().hashCode());
        result = prime * result + ((getSequence() == null) ? 0 : getSequence().hashCode());
        result = prime * result + ((getRangetype() == null) ? 0 : getRangetype().hashCode());
        result = prime * result + ((getStartposit() == null) ? 0 : getStartposit().hashCode());
        result = prime * result + ((getEndpositio() == null) ? 0 : getEndpositio().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fid=").append(fid);
        sb.append(", theGeom=").append(theGeom);
        sb.append(", id=").append(id);
        sb.append(", lbrid=").append(lbrid);
        sb.append(", marking=").append(marking);
        sb.append(", subtype=").append(subtype);
        sb.append(", sequence=").append(sequence);
        sb.append(", rangetype=").append(rangetype);
        sb.append(", startposit=").append(startposit);
        sb.append(", endpositio=").append(endpositio);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}